package paixu;

public class SelectSort {
    public static void main(String[] args) {
        int arr[]=new int[]{10,34,19,100,80};
        for (int i = 0; i < arr.length-1; i++) {
            int min=arr[i];
            int minindex=i;
            for (int j = i+1;j<arr.length;j++){
//                System.out.println(j);
                if(min<arr[j]){
                    min=arr[j];
                    minindex=j;
                }
            }
            if(minindex!=i){
                arr[minindex]=arr[i];
                arr[i]=min;
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
